package nayasis.common;


/**
 * 공통 상수를 모아놓은 공간
 * 
 * @author nayasis
 *
 */
public abstract class Const {

	public abstract class common {

		public static final String NEW_LINE = "-------------------------------------------------------------";
		
	}

    /**
     * Constants for developing WEB-UI
     */
    public static final class webUi {

        private webUi() {}

        public static final String SCRIPT_MESSAGE_POOL  = "nayasis.common.msg.pool";

    }
	
	/**
	 * 프로그램이 사용하는 기본 경로정보
	 * 
	 * @author nayasis
	 *
	 */
	public abstract static class path {

		// 설정 Home 디렉토리
		private static String home = "./resource";
		
		/**
		 * NayasisCommon 라이브러리가 참조하는 설정 Home 디렉토리를 세팅한다.
		 * 
		 * @param path Home 디렉토리 경로
		 */
		public static void setHome( String path ) {
			home = path;
		}
		
		/**
		 * NayasisCommon 라이브러리가 참조하는 설정 Home 디렉토리를 구한다.
		 * 
		 * @return
		 */
		public static String getHome() {
			return home;
		}
		
		/** configuration */
		public static String conf = getHome() + "/conf";

		/** SQL을 모아놓은 경로 */
		public static String sql  = getHome() + "/sql";
		
		/** local DB */
		public static String localDb  = getHome() + "/localDb";
		
		/** log */
		public static String log  = getHome() + "/log";
		
	}

	public abstract static class platform {

		public static final String  osName    = System.getProperty( "os.name"    );
		public static final String  osArch    = System.getProperty( "os.arch"    );
		public static final String  osVersion = System.getProperty( "os.version" );
		public static final String  osCharset = System.getProperty( "sun.jnu.encoding" );
		public static final String  jvmArch   = System.getProperty( "sun.arch.data.model" );
		public static final boolean isWindows = osName.startsWith( "Windows" );
		public static final boolean isLinux   = osName.startsWith( "Linux"   );
		public static final boolean isMac     = osName.startsWith( "Mac OS"  );		

	}
	
}
